package day0302;

import java.util.Date;

public class Demo {

    public static void main(String[] args) {
        Date date = new Date();
//        Date date1 = new Date(86400L * 1000 * 365 * 53);
//        Date date2 = new Date(123, 1, 30);
//
//        System.out.println(date);
//        System.out.println(date1);
//        System.out.println(date2);

        System.out.println(date);
        System.out.println(date.toLocaleString());
//        System.out.println(date.toGMTString());

        System.out.println("year: " + date.getYear()); // year - 1900
        System.out.println("month: " + date.getMonth()); // 0 - 11
        System.out.println("day of month: " + date.getDate()); // day of month
        System.out.println("day of week： " + date.getDay()); // day of week  Sunday = 0
        System.out.println("hours: " + date.getHours()); // 0 - 23
        System.out.println("minutes： " + date.getMinutes()); // 0 - 59
        System.out.println("seconds: " + date.getSeconds()); // 0 - 61
        System.out.println("time: " + date.getTime()); // 从 1970-01-01 00:00:00 到现在的 毫秒值

        date.setTime(1677723175880L - 86400L * 1000);

        System.out.println(date);
    }
}
